<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>then 方法 then</title>
</head>
<body>
    <script>
        let p = new Promise((resolve, reject) => {
            // resolve('ok');
            // resolve();
            reject('出错啦~~');
        });

        //指定 promise 实例对象成功与失败的回调
        p.then(value => {
            console.log(value);
        }, reason => {
            console.error(reason);
        })
    </script>
</body>
</html>